package com.mexico.inloancash.dialog;


import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;

import com.mexico.inloancash.R;
import com.mexico.inloancash.india_interfacedai.IndiaDealDialogInterface;

public class India_User_Photo_CommonDialog extends Dialog {
    private Button dialog_bottom;
    private TextView cancel;
    private Context context;
    private IndiaDealDialogInterface fragment;
    private TextView playPhoto;
    private TextView choosePhoto;
    private TextView cancleDialog;
     public India_User_Photo_CommonDialog(Context context, IndiaDealDialogInterface dialogInterface) {
        super(context,R.style.MyDialog);
        this.context = context;
        this.fragment = dialogInterface;
     }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.india_activity_photo_view_layout_dialog);
        Window win = getWindow();
        win.setGravity(Gravity.BOTTOM);

        WindowManager.LayoutParams lp = win.getAttributes();
        lp.width = WindowManager.LayoutParams.MATCH_PARENT;
        lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
        win.setAttributes(lp);
        setCanceledOnTouchOutside(false);
        playPhoto = findViewById(R.id.play_dialog);
        choosePhoto = findViewById(R.id.choose_dialog);
        cancleDialog = findViewById(R.id.cancel_dialog);
        playPhoto.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                fragment.doPlay();
                dismiss();
            }
        });
        choosePhoto.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                fragment.choose();
                dismiss();
            }
        });
        cancleDialog.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dismiss();
            }
        });
    }
}
